[SPARK-30688][SQL] Week based dates not being parsed with TimestampFormatter#27498
Closed
javierivanov wants to merge 11 commits intoapache:masterfrom
Closed
[SPARK-30688][SQL] Week based dates not being parsed with TimestampFormatter#27498javierivanov wants to merge 11 commits intoapache:masterfrom
javierivanov wants to merge 11 commits intoapache:masterfrom
Conversation
HyukjinKwon
reviewed
Feb 10, 2020
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
Outdated
Show resolved
Hide resolved
Member
|
cc @MaxGekk since you're touching the codes around here. |
MaxGekk
reviewed
Feb 10, 2020
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
Outdated
Show resolved
Hide resolved
|
Can one of the admins verify this patch? |
javierivanov
commented
Apr 13, 2020
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateFormatter.scala
Outdated
Show resolved
Hide resolved
MaxGekk
reviewed
Apr 14, 2020
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateFormatter.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeFormatterHelper.scala
Outdated
Show resolved
Hide resolved
Contributor
Author
|
ping @MaxGekk @HyukjinKwon :) |
cloud-fan
reviewed
May 19, 2020
| } else { | ||
| Seq( | ||
| (ChronoField.MONTH_OF_YEAR, 1), | ||
| (ChronoField.DAY_OF_MONTH, 1)) |
Contributor
There was a problem hiding this comment.
I found these default values are very fragile to be set here, so I remove them all in #28576 . Can you check if it fixes your problem?
|
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
When executing the following query using a week based pattern the result is null.
You can replicate this behavior with:
The date is parsed, but not resolved.
This is caused by the default temporal fields that are conflicting with the week based values:
To avoid this conflict, I propose to check if the pattern is a week/year based and change the defaults as follows:
Note:
Additonally in JDK8 there is know issue for patterns
(YYYYww/YYww)https://bugs.openjdk.java.net/browse/JDK-8145633 which fails to parse contiguos patterns without separation, this has been fixed in version 9. To avoid parsing issues add a separator like this(YYYY-ww/YYYY ww)Why are the changes needed?
Week/Year based dates should be supported since it is part of ISO8601. Also, as seen in SPARK-30688, this issue is failing silently.
Does this PR introduce any user-facing change?
How was this patch tested?
DateExpressionsSuite.scala